//导入工具类
import request from "@/utils/request";

//查询所有融资类型
export const getAllFinancing = (pageNum,pageSize,keyword) =>{
    return request.get(`/financing/page?pageNum=${pageNum}&pageSize=${pageSize}&keyWord=${keyword}`);
}


//查询总页数
export const getAllPage = (keyword) =>{
    return request.get(`/financing/count?keyWord=${keyword}`);
}

//删除融资类型
export const deleFinancing = (id) =>{
    let financing = {
        id:id,
    }
    return request.get("/financing/del",financing);
}
//修改融资类型
export const changeFinancing = (fin) =>{
    let financing
    if(fin.financingId == 0){
        financing = {
            financingName:fin.inputContent,
            tip: 0
        }
    }else{
        financing = {
            financingId:fin.financingId,
            financingName:fin.inputContent
        }
    }
    
    return request.post("/financing",financing);
}